<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>
<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="table-responsive">
                <table class="table table-sm" style="min-width: 800px">
                    <thead>
                    <tr>
                        <th colspan="2">
                            <strong>网址列表：</strong><span style="font-weight: 400;"><?php echo $url_list;?></span>
                            <p>总共： <span style="font-weight: 400;"><?php echo $total?> 条记录。重复记录：<?php echo $re;?>。去除重复记录，共入库<?php echo $total-$re;?></span></p>
                        </th>
                    </tr>
                    <tr>
                        <th width="400">标题：</th>
                        <th>网址：</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if (is_array($url))foreach ($url as $v){?>
                    <tr>
                        <td><?php echo $v['title']; ?></td>
                        <td><?php echo $v['url']; ?></td>
                    </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
            <?php if ($total_page > $page){ ?>
                <script>location.href="<?php echo url('collection-urls-'.$id.'-'.($page+1));?>"</script>
            <?php } else{ ?>
            <?php }?>
        </div>
    </div>
</div>
<!-- Modal -->
<div class="modal" id="done" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">采集完成</h5>
            </div>
            <div class="modal-body">
                <a class="btn btn-info" href="<?php echo url('collection-list');?>">返回列表</a>
                <a class="btn btn-info" href="<?php echo url('collection-contents-'.$id);?>">采集内容</a>
            </div>
        </div>
    </div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>
<?php if ($total_page <= $page){ ?>
<script>
    $('#done').modal('show');
</script>
<?php } ?>